package com.multi.thread.chapter02.demo08.test02;

public class Run {
	
	//当其他线程执行x对象中synchronized同步方法时呈同步效果
	//当其他线程执行x对象方法里面的synchronized(this)代码块时也呈现同步效果
	public static void main(String[] args) {
		MyService service = new MyService();
		MyObject object = new MyObject();
		
		MyThreadA a = new MyThreadA(service, object);
		a.setName("a");
		a.start();
		MyThreadB b = new MyThreadB(object);
		b.setName("b");
		b.start();
	}
	
}
